/**
 * 
 */
package org.xlab.baseframework.system;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 系统事件发布器
 * 
 * @author MaKuBEX
 * 
 */
@Component
public class SystemEventPublisher implements ApplicationEventPublisher,
		ApplicationContextAware {

	private ApplicationContext applicationContext;

	/**
	 * @see org.springframework.context.ApplicationEventPublisher#publishEvent(org.springframework.context.ApplicationEvent)
	 */
	public void publishEvent(ApplicationEvent arg0) {
		this.applicationContext.publishEvent(arg0);
	}

	/**
	 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
	 */
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		this.applicationContext = arg0;
	}

}
